﻿using System;


namespace HAVNet.Intros.AST
{
    public class ASTEmbStmtForeach : ASTEmbStmt
    {
        public ASTType          type        { get; set; }
        public string           ident       { get; set; }
        public ASTExpr          expression  { get; set; }
        public ASTStatement     statement   { get; set; }

        public override string ToString ( )
        {
            string sforeach = string.Format (
                "foreach ({0} {1} in {2})",
                type,
                ident,
                expression
            );

            return sforeach + Environment.NewLine + statement.ToString();
        }
    }
}
